package com.wxit.threadlocal.sort;

import lombok.val;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class ThreadSort {
    public static void main(String[] args) {
        int numbers[] = new int[]{1, 3, 45, 78, 85, 55};


        //
        for (int i = 0; i < numbers.length; i++) {
            final int finalI = i;
            new Thread(() -> {
                try {
                    Thread.sleep(numbers[finalI]);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                System.out.println(numbers[finalI]);
            }).start();
        }
    }
}
